<template>
	<view style="padding-bottom:125rpx;">
		<view class="topFixed"></view>
		<view class="" style="width: 100%;height: 80rpx;"></view>
		<view class="header">
			<view class="headerTop">
				<image src="/static/image/home/logo.png" mode="widthFix"></image>
			</view>
			<view class="userInfoBox">
				<view class="infoBoxLeft" @click="goLogin('/subpackages/userInfo/userInfo')">
					<u-avatar :src="userInfo.avatar" size="48"></u-avatar>
					<text>{{(userInfo.realname || userInfo.username )|| '未登录'}}</text>
				</view>
			<!-- 	<u-icon name="bell" color="#fff" size="28" @click="goLogin('/subpackages/message/message')"></u-icon> -->
			</view>
		</view>
		<view class="poster">
			<image src="/static/image/mine/banner.png" mode="widthFix"></image>
			<text>欢迎加入我们</text>
		</view>
		<view class="serviceBox">
			<p>我的服务</p>
			<view class="itemBox">
				<view v-for="(item,index) in serviceList" :key="index" class="item" @click="goLogin(item.path)">
					<image :src="item.icon" mode="widthFix"></image>
					<text>{{item.text}}</text>
				</view>
				<view v-if="userInfo.userType==1" class="item"
					@click="goLogin('/subpackages/salesman/salesman')">
					<image src="/static/image/mine/icon8.png" mode="widthFix"></image>
					<text>业务员入口</text>
				</view>
				<view v-if="userInfo.userType==3" class="item"
					@click="goLogin('/subpackages/powerSales/powerSales')">
					<image src="/static/image/mine/daili.png" mode="widthFix"></image>
					<text>代理商入口</text>
				</view>
				<view v-if="userInfo.userType==4 || userInfo.userType==5" class="item"
					@click="goLogin('/subpackages/customerFollow/customerFollow',{type:userInfo.userType})">
					<image src="/static/image/mine/reviewIcon.png" mode="widthFix"></image>
					<text>{{userInfo.userType==4?'我的审批':'我的复核'}}</text>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex'
	export default {
		data() {
			return {
				launchUserId: '',
				shareShow: true,
				payShow: true,
				serviceList: [{
					text: '个人信息',
					icon: '/static/image/mine/icon5.png',
					path: '/subpackages/userInfo/userInfo',
					show: true,
				}, 
				{
					text: '绿电绿证',
					icon: '/static/image/mine/icon7.png',
					path: '/subpackages/operationalFlow/operationalFlow?type=2',
					show: false,
				},
				{
					text: '案例学习',
					icon: '/static/image/mine/icon6.png',
					path: '/subpackages/caseStudy/caseStudy',
					show: true,
				} ]
			};
		},
		computed: {
			...mapState({
				userInfo: state => state.userInfo,
			})
		},
		created() {
		},
		methods: {
			
		
		}

	}
</script>
<style>
	page {
		background-color: #F8FBFF;
		min-height: 100vh;
		padding-bottom: 150rpx;
		box-sizing: border-box;
	}
</style>
<style lang="scss" scoped>
	@import 'mine.scss'
</style>